package Work.com;

import java.util.Random;
import java.util.Scanner;

public class Exam02 {
    public static void suiJi(int num){
        String str = "";
        Random random = new Random();
        for (int i = 0; i <=num; i++) {
            int type = random.nextInt(3) ;
            switch (type){
                case 0 ->{
                    char ch = (char) (random.nextInt(26) + 65 );
                    str += ch;
                }
                case 1 ->{
                    char ch1 = (char) (random.nextInt(26) + 97 );
                    str += ch1;
                }
                case 2 ->{
                    str += random.nextInt(10);
                }
            }
        }
        System.out.println(str);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入随机码的个数：");
        int num = sc.nextInt();
        suiJi(num);
    }
}
